package com.jf.hotelreservation.demos.controller.wx;

import com.jf.hotelreservation.demos.service.HotelService;
import com.jf.hotelreservation.demos.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wx")
public class WXHotelController {

    @Autowired
    private HotelService service;
    @Autowired
    private RoomService roomService;


    /**
     * 客户端发送数据
     * 城市code
     */
    @GetMapping("/hotel/getHotel")
    public String getHotel(Integer cityCode){
        return service.queryByCity(cityCode);
    }

    @GetMapping("/room/getRoomById")
    public String getRoom(Integer hid){
        return roomService.queryAll(hid);
    }

    @GetMapping("/room/getRoomByRid")
    public String getRoomByRid(Integer id){
        return roomService.queryRoom(id);
    }
}
